package com.wm.bridge;

import java.math.BigDecimal;

/**
 * @ClassName: WxPay
 * @Description: 微信支付
 * @Author: WM
 * @Date: 2023/3/20 19:47
 */
public class WxPay extends Pay {
    public WxPay(IPayModel payModel) {
        super(payModel);
    }

    @Override
    public String transfer(String uId, String traceId, BigDecimal amount) {
        logger.info("模拟微信渠道支付划账开始，uId：{} tradeId：{} amount：{}", uId, traceId, amount);
        boolean ok = payModel.security(uId);
        logger.info("模拟微信渠道⽀付风控校验，security：{} ", ok);
        if (!ok) {
            logger.info("模拟微信渠道⽀付划账拦截");
            return "0001";
        }
        logger.info("模拟微信渠道⽀付划账成功");
        return "0000";
    }
}
